<template>
    <div class="gongxushangchengBox">
        <div class="topBox">
            <div class="topBoxTitle">资源类型：{{ formData.type }}资源</div>
            <div>公司</div>
        </div>
        <div class="nrBox">
            <div class="nrBoxLeft">
                <img style="width: 100%;height: 100%;" 
                    :src="formData.file_path == 'UpLoadFiles\\shop.png'?`https://image.pollinations.ai/prompt/${formData.product_name.split('、')[0]}`:store.imgfengMian + formData.file_path" 
                    alt="" loading="lazy">
            </div>
            <div class="nrBoxRight">
                <div class="nrRightflex">
                    <div class="nrRightTitle">{{ formData.product_name }}</div>
                    <!-- <div class="nrRightText">
                        <div>法定代表人：法定代表人</div>
                        <div>注册资本：注册资本</div>
                        <div>成立日期：成立日期</div>
                        <div>统一社会信用代码：统一社会信用代码</div>
                        <div>企业地址：企业地址</div>
                    </div> -->
                    <div class="nrRightText">
                        <div>供应数量：{{ formData.quantity }}{{ formData.unit }}</div>
                        <div>期望单价：￥{{ formData.price }}/{{ formData.unit }}</div>
                        <div>发货地：{{ formData.fahuo_addresss }}</div>
                        <!-- <div>截止日期：{{ formData.eff_time }}</div> -->
                    </div>
                    <div class="nrRightText" >要求：{{ formData.require }}</div>
                </div>
                <div class="nrRightButton">
                    <div class="bddhBox" @click="detailseJump">详情</div>
                </div>
            </div>
        </div>
    </div>
</template>
<script setup>
import { useStore } from '@/store/store';
const store = useStore()
import { useRouter } from 'vue-router';
const router = useRouter();
const props = defineProps({
    formData: {
        type: Object,
        default: () => ({})
    }
})
// 供需详情跳转
const detailseJump = () => {
    router.push({ path: '/ProductDetails', query: { id: props.formData.product_Id } })
}
</script>
<style scoped lang="scss">
.gongxushangchengBox {
    padding: 8px;
    background: #fff;
    border-radius: 8px;

    .topBox {
        border-bottom: 1px solid #ccc;
        padding: 8px;
        font-size: 16px;
        color: #333333;
        display: flex;
        align-items: center;
        justify-content: space-between;

        .topBoxTitle {
            font-weight: bold;

        }
    }

    .nrBox {
        padding: 8px;
        display: flex;
        gap: 8px;

        .nrBoxLeft {
            width: 15%;
            height: auto;
            aspect-ratio: 1/1;
            object-fit: cover;
            border-radius: 8px;
            overflow: hidden;
        }

        .nrBoxRight {
            display: flex;
            flex-grow: 1;
            justify-content: space-between;

            .nrRightflex {
                padding: 12px;
                display: flex;
                flex-direction: column;
                justify-content: space-between;
                width: 85%;

                .nrRightTitle {
                    font-weight: bold;
                    font-size: 20px;
                    color: #333333;
                    margin-bottom: 10px;
                }

                .nrRightText {
                    font-weight: 300;
                    font-size: 14px;
                    color: #333333;
                    display: flex;
                    flex-wrap: wrap;
                    div {
                        margin-right: 20px;
                        margin-bottom: 10px;
                    }
                }

            }

            .nrRightButton {
                flex-shrink: 0;
                display: flex;
                align-items: center;

                .bddhBox {
                    font-size: 16px;
                    color: #FFFFFF;
                    padding: 12px 28px;
                    background: $button-color;
                    border-radius: 6px;
                    cursor: pointer;
                }
            }

        }
    }
}
</style>